﻿/**
*人效计算
*/
Chenxin.UI.CalculateForm = Chenxin.extend(Chenxin.UI.FormCommon,{
    actionUrl:'/service/logic/EfficencyManage.ashx',
    id:'Calculate',
    renderTo:'divCalculate',
    winCls:'',
    jqmWidth:300,
    defBBtn:true,
    createForm: function() {
        return Chenxin.FormCommon.CalculateForm(this.id);
    },
	initFormValidator:function(){
         //生成年月
         $("#YearMonth").formValidator({
            validatorgroup: this.id,
            onshow: "请输入生成年月！",
            onfocus: "生成年月格式：YYYYMM",
            oncorrect: " "
        }).inputValidator({ 
            min: 1,
            empty: {
                leftempty: false,
                rightempty: false,
                emptyerror: "生成年月不能为空！"
            },
            onerror: "生成年月不能为空！"
        });
    },
    initEvent: function() {
		/*************事件：生成年月得到焦点*************/
        $("#YearMonth").focus(function(){
            WdatePicker({
                dateFmt:'yyyy.MM',
                oncleared:function(){
                            $(this).blur();
                          },
                onpicked:function(){
                            $(this).blur();
                         }
            });
        });
    },
    saveSucc: function() {
        this.reloadGrid();
    },
    initComponent: function() {
        Chenxin.UI.CalculateForm.superclass.initComponent.call(this);
    }
});

Chenxin.FormCommon.CalculateForm=function(formID){
return '<table class="tbl_f"><tr><th style="width:105px; height:26px;">生成年月：</th><td><input type="text" id="YearMonth" name="YearMonth" class="inputbox_n fl" style="width:151px" /><div id="YearMonthTip" style="float: left; margin-left: 5px; height: 26px; line-height: 26px; text-align: left;" class="fl"></div></td></tr><tr><td colspan="2" ><input type="hidden"  name="RecordId" /></td></tr></table>';
};